package org.example.bean;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
@Data
@Lazy
@Component
public class BeanE {

    @Value("注解开发")
    private String tag;

    public BeanE() {
        System.out.println("构造函数...");
    }

    @PostConstruct
    public void init(){
        System.out.println("init 方法...");
    }

    @PreDestroy
    public void destroy(){
        System.out.println("destroy 方法...");
    }

    public String getTag() {
        return tag;
    }

    public void setTag(String tag) {
        System.out.println("属性注入...");
        this.tag = tag;
    }
}
